import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
import locale from 'element-plus/lib/locale/lang/zh-cn'
import './styles/global.css'

// 引入字体文件
import './assets/font/iconfont.css'
// 导入字体图标
import './assets/fonts/iconfont.css'

// 导入富文本编辑器
import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css'

import axios from 'axios'
// axios.defaults.baseURL = 'http://jpgs.test.geely.com/'
// axios.defaults.baseURL = 'https://admin-jpgs.geely.com/'

axios.interceptors.request.use(config => {
    config.headers['x-auth-token'] = window.sessionStorage.getItem('token')
    return config
})

const app = createApp(App).use(store).use(router).use(ElementPlus, { locale })
app.component('QuillEditor', QuillEditor)
app.config.globalProperties.$http = axios
app.mount('#app')
